<template>
  <view class="content">
    <!-- 图标 -->
    <uni-icons type="contact-filled" size="100" color="#AFAFAF"></uni-icons>
    <!-- 登录按钮 -->
    <button type="primary" class="content-loginBtn" open-type="getUserInfo" @getuserinfo="getUserInfo">一键登录</button>
    <!-- 登录提示 -->
    <view class="content-tips">
      登录后尽享更多权益
    </view>
  </view>
</template>

<script>
  import {
    TOAST_SHOW_FAIL
  } from '@/utils/view_utils.js'
  import {
    mapMutations
  } from 'vuex'
  export default {
    name:"my-login",
    data() {
      return {
        
      };
    },
    methods: {
      ...mapMutations('m_user',['updataUserInfo']),
      // 获取用户信息
      getUserInfo(e) {
        if(e.detail.errMsg === 'getUserInfo:fail auth deny') return TOAST_SHOW_FAIL('您取消了授权')
        // 更新用户的信息
        this.updataUserInfo(e.detail.userInfo)
      }
    }
  }
</script>

<style lang="scss">
.content {
  height: 750rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #F8F8F8;
  position: relative;
  overflow: hidden;
  &::after {
    content: ' ';
    display: block;
    position: absolute;
    width: 100%;
    height: 40px;
    left: 0;
    bottom: 0;
    background-color: white;
    border-radius: 100%;
    transform: translateY(50%);
  }
  &-loginBtn {
    width: 90%;
    border-radius: 100px;
    margin: 15px 0;
    background-color: #C00000;
  }
  &-text {
    font-size: 12px;
    color: gray;
  }
}
</style>
